﻿#pragma once
#include <QDialog>
#include <QTableWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>
#include "UndoRedo_ScheduleAdminDialog.h"

class ScheduleAdminDialog : public QDialog {
    Q_OBJECT
public:
    ScheduleAdminDialog(QWidget* parent = nullptr);
    void refreshScheduleTable();
private slots:
    void onAddSchedule();
    void onDeleteSchedule();
    void onEditSchedule();
    void onSearchSchedule();
    void updateRecordCount();

private:
    QTableWidget* table;
    QLineEdit* idEdit;
    QLineEdit* trainIdEdit;
    QLineEdit* stationIdEdit;
    QLineEdit* arrivalEdit;
    QLineEdit* departEdit;
    QLineEdit* orderEdit;
    QLineEdit* searchEdit;
    QPushButton* addBtn;
    QPushButton* deleteBtn;
    QPushButton* editBtn;
	QPushButton* UndoBtn;
	QPushButton* RedoBtn;
    QPushButton* searchBtn;
    QLabel* recordCountLabel;
    QLabel* infoLabel;
	UndoRedo_ScheduleAdminDialog undoRedo;
    void showInfo(const QString& msg);
};
